import java.util.Scanner;

/**
 * Created with Intellij IDEA
 * Description
 * User:ASUS
 * Date:2024-09-06
 * Time:17:53
 */
public class Test {
    public static void main(String[] args) {
        String input="edgnbhjgjjh";
        Scanner sc=new Scanner(System.in);
        String str=sc.next();
        System.out.println();
        System.out.println(count(input,"edgnb"));
    }
    public static int count(String str,String pattern){
        int count=0;
        int len=str.length();
        int patLen=pattern.length();
        if(len<patLen){
            return 0;
        }
        for (int i = 0; i <= len - patLen; i++) {
            if (str.substring(i, i + patLen).equals(pattern)) {
                count++;
            }
        }
        return count;
    }
}
